<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.2</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="css/font.css">
    <link rel="stylesheet" href="css/xadmin.css">
    <link rel="stylesheet" href="css/admin.css">
    <script src="lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .procu_show_p{
            height: 38px;
            line-height: 38px;
            font-weight: bold;
        }
        .procu_show_p_long{
            font-weight: bold;
        }
    </style>
</head>


<body>
<div class="x-nav">
                <span class="layui-breadcrumb">
                    <a href="">首页</a>
                    <a href="">供应商管理</a>
                    <a>
                        <cite>查看供应商</cite></a>
                    <a>
                        <cite>黑名单申请</cite></a>
                </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
    </a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <form class="layui-form" id="black">
                    <div class="layui-form-item">
                        <div class="layui-card-body ">
                            <fieldset class="layui-elem-field">
                                <legend>黑名单申请</legend>
                                <div class="layui-field-box">
                                    <div class="layui-row">

                                        <div class="layui-col-md4">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">供应商名称：</label>
                                                <div class="layui-input-inline" style="width: 200px;">
                                                    <p class="procu_show_p">${supply_name}</p>
                                                </div>
                                            </div>
                                        </div>
                                        <textarea name="blacklist_msg" cols="60" rows="8"></textarea>
                                        <input name="supply_name" value="${supply_name}" type="hidden">
                                        <div class="layui-row">
                                            <div class="pro_form_div" style="margin: 0 auto;width: 150px;padding-bottom: 40px;">
                                                <button class="layui-btn" lay-filter="commit" lay-submit="">提交</button>
                                                <a class="layui-btn" href="javascript:history.back(-1)">返回</a>
                                            </div>

                                        </div>

                                    </div>
                                </div>
                            </fieldset>
                        </div>


                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</div>

<script>
    layui.use(['laydate', 'form'], function () {
        var laydate = layui.laydate;
        var form = layui.form,
            layer = layui.layer;
        $ = layui.jquery;

        form.on('submit(commit)',
            function (data) {
               var name = data.field.supply_name;
                $.ajax({
                    type:"post",
                    url:"/blacklist",
                    dataType:"json",
                    data: $('#black').serialize(),
                    success:function (data) {
                        if (data > 0){
                            layer.alert('申请成功',
                                {icon: 6}
                                ,function (index) {
                                    window.location.href="to_supplylist";
                                });
                        }

                        }

                });
                    return false;
            });
    });

</script>

</body>

</html>
